package homework.day11;

import java.util.*;

/**
 * 生成10个0-100之间的不重复的随机数,并输出
 *
 * @author Xiloer
 */
public class Test03 {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        Random random = new Random();
        for (; ; ) {
            set.add(random.nextInt(100));
            if (set.size() == 10) {
                for (Integer i : set) {
                    System.out.println(i);
                }
                break;
            }
        }
        System.out.println(set.size());
    }
}
